package com.qingshu.async;

import com.qingshu.common.entity.sys.OperatorLog;
import com.qingshu.common.util.spring.SpringUtils;
import com.qingshu.service.IOperatorLogService;

import java.util.TimerTask;

/**
 * 操作日志任务
 * @author Huzz
 * @created 2021-12-08 18:23
 */
public class LogTask {

    /**
     * 保存操作日志
     * @param operatorLog
     * @return
     */
    public static TimerTask insertOperatorLogTask(OperatorLog operatorLog){
        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(IOperatorLogService.class).save(operatorLog);
            }
        };
    }
}
